Skip to content
This repository was archived by the owner on Aug 4, 2021. It is now read-only.

Conversation

@NotWoods
Copy link
Member

@NotWoods NotWoods commented Apr 9, 2019

My continued efforts to fully support typechecking a Rollup config with TypeScript.

TypeScript allows for checking normal Javascript files by adding a // @ts-check comment at the top of the file. By providing typings users can check that they aren't passing misspelled or incorrect parameters, and see a hint about what each option does in their editor.

Fixes #137


Since the plugin accepts the same options as TypeScript's compiler options, I initially experimented with extending the exported CompilerOptions type. Unfortunately that interface doesn't match up with the JSON schema, and uses enums for certain values like target. I ended up just using an index type instead, although the types are slightly weaker. TypeScript just uses any for its JSON parsing function so this should be fine.

@shellscape
Copy link
Contributor

@NotWoods if you're up for fixing the conflict, I'll merge this immediately.

@NotWoods
Copy link
Member Author

Updated!

@shellscape shellscape merged commit 30079e8 into rollup:master Nov 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Looking forward to an index.d.ts

2 participants